<template>
  <div class="profile-container">
    <div class="profile-header">
      <h1>我的页面</h1>
    </div>
    <div class="profile-items">
      <el-card class="box-card" @click="goToAddressManagement">
        <div class="card-content">
          <i class="el-icon-location-outline card-icon"></i>
          <div>地址管理</div>
        </div>
      </el-card>
      <el-card class="box-card" @click="goToMyOrders">
        <div class="card-content">
          <i class="el-icon-s-order card-icon"></i>
          <div>我的订单</div>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup>
// 导入必要的Vue和Element Plus组件
import { ElCard } from "element-plus";
import { useRouter } from "vue-router";
const router = useRouter();
// 示例跳转函数，需要根据你的路由配置来实现具体跳转逻辑
const goToAddressManagement = () => {
  router.push("/user/address");
};

const goToMyOrders = () => {
  router.push("/user/myorder");
};
</script>
<style scoped>
.profile-container {
  max-width: 800px;
  margin: 20px auto;
}

.profile-header h1 {
  text-align: center;
  color: #333;
}

.profile-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.box-card {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  height: 120px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card-content {
  text-align: center;
  font-size: 30px;
}

.card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.box-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
</style>